package org.kgduyjj.test.bean;

import java.util.Date;

import org.kgduyjj.toolbox.DateUtil;
import org.kgduyjj.toolbox.bean.BaseJson;
import org.kgduyjj.toolbox.enumtype.Gender;

import com.fasterxml.jackson.annotation.JsonFormat;

public class Person extends BaseJson {
	/** */
	private static final long serialVersionUID = 1L;
	protected String name;
	protected Gender sex;
	protected int age;
	protected Date birthday;
	protected Friends friends;

	public Person() {
	}

	public Person(String name, Gender sex, int age) {
		super();
		this.name = name;
		this.sex = sex;
		this.age = age;
		int yearDays = (365 * this.getAge());
		this.birthday = DateUtil.addDays(new Date(), (0 - yearDays));
	}

	public Person(String name, Gender sex, int age, Date birthday) {
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.birthday = birthday;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Gender getSex() {
		return sex;
	}

	public void setSex(Gender sex) {
		this.sex = sex;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@JsonFormat(timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm:ss")
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Friends getFriends() {
		return friends;
	}

	public void setFriends(Friends friends) {
		this.friends = friends;
	}

}
